
class student :
    school = '黑马篮球大学'
    def __init__ (self ,name , age , time) :
        self.name = name
        self.age = age
        self.time = time
    def __str__(self) -> str:
        return f'{stu.age}岁的{stu.name}在{stu.school}练习{stu.time}'
stu = student ('坤坤' , 17 , '两年半')
print(stu)

name = ['张三' , '李四' , '王五' , '赵六'] #列表
print(name)
age = (17 , 18 , 19 , 20) #元组
print(age)
phone = {10086 , 10010 , 123123 , 110110} #集合:集合是无序的
print(phone)
print(type(phone))
gender = {'张三':'男' , '李四':'女' , '王五':'男' , '赵六':'女'} #字典
print(gender)
print(type(gender))

number = [ele for ele in range(1,100)] #推导式
print(number)
double = [i for i in number if i%2 == 0] #推导式
print(double)


for i in range(1,10):
    for j in range(1,i+1):
        print(f'{j}*{i}={i*j}\t',end='')
        j += 1
    print()
    i += 1
print('*'*80)
i = 1 
while i <= 9 :
    j = 1
    while j <= i :
        print(f'{j}*{i}={j*i}\t',end='')
        j += 1
    print()
    i += 1
    
class zhendeman :
    def __init__ (self,action1,action2,action3 ,action4):
        self.action1 = action1
        self.action2 = action2
        self.action3 = action3
        self.action4 = action4
    def __str__(self) -> str:
        return f'爱好是:{man.action1},{man.action2},{man.action3},{man.action4}'
    
man = zhendeman ('唱','跳','rap','篮球')
print(man)
print(f'{man.action1}')
